import request from '@/config/axios'

// 申请开展评价的职业（工种）关联 VO
export interface FilingOccupationVO {
  id: number // 序号
  filingCreationId: number // 创建备案主表ID（关联filing_creation.id）
  occupationCode: string // 职业编码
  occupationName: string // 职业名称
  workTypeName: string // 工种名称
  workTypeLevel: string // 工种级别
  recognitionBasis: string // 认定依据
}

// 申请开展评价的职业（工种）关联 API
export const FilingOccupationApi = {
  // 查询申请开展评价的职业（工种）关联分页
  getFilingOccupationPage: async (params: any) => {
    return await request.get({ url: `/eval/filing-occupation/page`, params })
  },

  // 查询申请开展评价的职业（工种）关联详情
  getFilingOccupation: async (id: number) => {
    return await request.get({ url: `/eval/filing-occupation/get?id=` + id })
  },

  // 新增申请开展评价的职业（工种）关联
  createFilingOccupation: async (data: FilingOccupationVO) => {
    return await request.post({ url: `/eval/filing-occupation/create`, data })
  },

  // 修改申请开展评价的职业（工种）关联
  updateFilingOccupation: async (data: FilingOccupationVO) => {
    return await request.put({ url: `/eval/filing-occupation/update`, data })
  },

  // 删除申请开展评价的职业（工种）关联
  deleteFilingOccupation: async (id: number) => {
    return await request.delete({ url: `/eval/filing-occupation/delete?id=` + id })
  },

  // 导出申请开展评价的职业（工种）关联 Excel
  exportFilingOccupation: async (params) => {
    return await request.download({ url: `/eval/filing-occupation/export-excel`, params })
  }
}